<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.entity.Concept.processQuestion</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d4/d22/classnars_1_1entity_1_1Concept_a3900248991e7adb57e82231312337f8f.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="a3900248991e7adb57e82231312337f8f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float nars.entity.Concept.processQuestion </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/ddc/classnars_1_1entity_1_1Task.html">Task</a>&#160;</td>
          <td class="paramname"><em>task</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To answer a question by existing beliefs. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">task</td><td>The task to be processed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether to continue the processing of the task </dd></dl>

<p>Definition at line <a class="el" href="../../df/d62/Concept_8java_source.html#l00144">144</a> of file <a class="el" href="../../df/d62/Concept_8java_source.html">Concept.java</a>.</p>

<p>References <a class="el" href="../../d8/df2/Term_8java_source.html#l00094">nars.language.Term.equals()</a>, <a class="el" href="../../df/d62/Concept_8java_source.html#l00245">nars.entity.Concept.evaluation()</a>, <a class="el" href="../../da/d1c/Sentence_8java_source.html#l00133">nars.entity.Sentence.getContent()</a>, <a class="el" href="../../de/de7/TruthValue_8java_source.html#l00077">nars.entity.TruthValue.getExpectation()</a>, <a class="el" href="../../d6/d10/Task_8java_source.html#l00099">nars.entity.Task.getSentence()</a>, <a class="el" href="../../da/d1c/Sentence_8java_source.html#l00165">nars.entity.Sentence.getTruth()</a>, <a class="el" href="../../db/d0c/Memory_8java_source.html#l01143">nars.storage.Memory.Parameters.MAXIMUM_QUESTIONS_LENGTH</a>, and <a class="el" href="../../d0/db7/LocalRules_8java_source.html#l00118">nars.inference.LocalRules.trySolution()</a>.</p>

<p>Referenced by <a class="el" href="../../df/d62/Concept_8java_source.html#l00096">nars.entity.Concept.directProcess()</a>.</p>
<div class="fragment"><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                                            {</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        Sentence ques = task.getSentence();</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <span class="keywordtype">boolean</span> newQuestion = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="../../d4/d22/classnars_1_1entity_1_1Concept_a64d60676d973a0ebf9132552d01522c2.html#a64d60676d973a0ebf9132552d01522c2">questions</a> != null) {</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            <span class="keywordflow">for</span> (Task t : <a class="code" href="../../d4/d22/classnars_1_1entity_1_1Concept_a64d60676d973a0ebf9132552d01522c2.html#a64d60676d973a0ebf9132552d01522c2">questions</a>) {</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;                Sentence q = t.getSentence();</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;                <span class="keywordflow">if</span> (q.getContent().equals(ques.getContent())) {</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;                    ques = q;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;                    newQuestion = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                }</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            }</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        }</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        <span class="keywordflow">if</span> (newQuestion) {</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;            questions.add(task);</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        }</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <span class="keywordflow">if</span> (questions.size() &gt; Memory.Parameters.MAXIMUM_QUESTIONS_LENGTH) {</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;            questions.remove(0);    <span class="comment">// FIFO</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        }</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        Sentence newAnswer = <a class="code" href="../../d4/d22/classnars_1_1entity_1_1Concept_a3da4b5320acef5ecbcb256090e4aff94.html#a3da4b5320acef5ecbcb256090e4aff94">evaluation</a>(ques, <a class="code" href="../../d4/d22/classnars_1_1entity_1_1Concept_a8b68e5eb605ffd96cf53c86b5368caa2.html#a8b68e5eb605ffd96cf53c86b5368caa2">beliefs</a>);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        <span class="keywordflow">if</span> (newAnswer != null) {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="comment">//            LocalRules.trySolution(ques, newAnswer, task, memory);</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;            LocalRules.trySolution(newAnswer, task, <a class="code" href="../../d4/d22/classnars_1_1entity_1_1Concept_a2ab0b0c82e09c852076ce4c90c502d4c.html#a2ab0b0c82e09c852076ce4c90c502d4c">memory</a>);</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;            <span class="keywordflow">return</span> newAnswer.getTruth().getExpectation();</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;            <span class="keywordflow">return</span> 0.5f;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        }</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1entity_1_1Concept_a8b68e5eb605ffd96cf53c86b5368caa2_html_a8b68e5eb605ffd96cf53c86b5368caa2"><div class="ttname"><a href="../../d4/d22/classnars_1_1entity_1_1Concept_a8b68e5eb605ffd96cf53c86b5368caa2.html#a8b68e5eb605ffd96cf53c86b5368caa2">nars.entity.Concept.beliefs</a></div><div class="ttdeci">ArrayList&lt; Sentence &gt; beliefs</div><div class="ttdoc">Sentences directly made about the term, with non-future tense. </div><div class="ttdef"><b>Definition:</b> <a href="../../df/d62/Concept_8java_source.html#l00061">Concept.java:61</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Concept_a2ab0b0c82e09c852076ce4c90c502d4c_html_a2ab0b0c82e09c852076ce4c90c502d4c"><div class="ttname"><a href="../../d4/d22/classnars_1_1entity_1_1Concept_a2ab0b0c82e09c852076ce4c90c502d4c.html#a2ab0b0c82e09c852076ce4c90c502d4c">nars.entity.Concept.memory</a></div><div class="ttdeci">Memory memory</div><div class="ttdoc">Reference to the memory. </div><div class="ttdef"><b>Definition:</b> <a href="../../df/d62/Concept_8java_source.html#l00063">Concept.java:63</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Concept_a64d60676d973a0ebf9132552d01522c2_html_a64d60676d973a0ebf9132552d01522c2"><div class="ttname"><a href="../../d4/d22/classnars_1_1entity_1_1Concept_a64d60676d973a0ebf9132552d01522c2.html#a64d60676d973a0ebf9132552d01522c2">nars.entity.Concept.questions</a></div><div class="ttdeci">List&lt; Task &gt; questions</div><div class="ttdoc">Question directly asked about the term. </div><div class="ttdef"><b>Definition:</b> <a href="../../df/d62/Concept_8java_source.html#l00059">Concept.java:59</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1Concept_a3da4b5320acef5ecbcb256090e4aff94_html_a3da4b5320acef5ecbcb256090e4aff94"><div class="ttname"><a href="../../d4/d22/classnars_1_1entity_1_1Concept_a3da4b5320acef5ecbcb256090e4aff94.html#a3da4b5320acef5ecbcb256090e4aff94">nars.entity.Concept.evaluation</a></div><div class="ttdeci">Sentence evaluation(Sentence query, Iterable&lt; Sentence &gt; list)</div><div class="ttdoc">Evaluate a query against beliefs (and desires in the future) </div><div class="ttdef"><b>Definition:</b> <a href="../../df/d62/Concept_8java_source.html#l00245">Concept.java:245</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d22/classnars_1_1entity_1_1Concept_a3900248991e7adb57e82231312337f8f_a3900248991e7adb57e82231312337f8f_cgraph.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

<p><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d22/classnars_1_1entity_1_1Concept_a3900248991e7adb57e82231312337f8f_a3900248991e7adb57e82231312337f8f_icgraph.svg" width="100%" height="388"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../db/dec/namespacenars_1_1entity.html">entity</a></li><li class="navelem"><a class="el" href="../../d4/d22/classnars_1_1entity_1_1Concept.html">Concept</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
